package com.doudou.collection.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doudou.collection.orm.entity.Announcement;
import com.doudou.collection.orm.vo.AnnouncementVO;
import org.springframework.stereotype.Repository;

import java.util.List;
/**
 * @ClassName AnnouncementMapper<br>
 * @Description 公告Mapper类<br>
 * @Author 王林峰<br>
 * @Date 2023/6/23 15:02<br>
 * @Version 1.0<br>
 */
@Repository
public interface AnnouncementMapper extends BaseMapper<Announcement> {
    /**
     * 发布公告
     * @param announcement
     */
    int insert(Announcement announcement);


    /**
     * 修改删除状态
     * @param announcement
     * @return
     */
    int updateDelFlag(Announcement announcement);

    /**
     * 修改撤回状态
     * @param announcement
     * @return
     */
    int updateIfCancel(Announcement announcement);


    /**
     * 查询所有公告
     * @return
     */
    List<AnnouncementVO> selectAll();


    /**
     * 根据id修改公告
     * @param announcement
     * @return
     */
    int updateAnnouncement(Announcement announcement);




    /**
     * 通过id查询公告
     * @param id
     * @return
     */
    AnnouncementVO getAnnouncementById(Long id);
}
